   <template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      selectionType="multiple"
      :datakey="'rows'"
       height="200px"
      :onColumnsChange="columns => this.columns = columns"
      :onRowSelectChange="arr => this.onChangeColumn = arr"
      :isColumnFilter="false"
    ></FilterTable>

    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9999,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'center'
      }"
    >
      <el-button @click="closeDialog">取消</el-button>
    </div>
  </div>
</template>

<script>
//查询跟踪历史
import { dictionary } from '@/utils/dictMixin';
import { historyQuery } from '@/api/derived/insurance/insurancePolicy';
export default {
  name: '',
  props: ['TBcode'],
  mixins: [dictionary],
  data() {
    this.basetable = null;
    return {
      columns: this.createTable(),
      fetchApi: historyQuery,
      fetchParams: {
        xhrAbort: false,
        proposalCode: this.TBcode
      }
    };
  },
  methods: {
    createTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '投保单号',
          dataIndex: 'PROPOSAL_CODE',
          sorter: true,
          filter: true
        },
        {
          title: '接触内容',
          dataIndex: 'TRACK_CONTENT',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
        },
        {
          title: '跟踪状态',
          dataIndex: 'TRACE_TYPE',
          sorter: true,
          filter: true,
          render: props => {
            return <span>{this.createDictText(props.row.TRACE_TYPE, '8058')}</span>;
          }
        },
        {
          title: '战败原因',
          dataIndex: 'DESC_FAILURE_REASON',
          sorter: true,
          filter: true,
          showOverflowTooltip: true
        },
        {
          title: '跟踪日期',
          dataIndex: 'INPUT_DATE',
          sorter: true,
          filter: true,
          dateFormat: 'yyyy-MM-dd'
        },
        {
          title: '下次跟踪日期',
          dataIndex: 'TRACK_NEXT_DATE',
          sorter: true,
          filter: true,
          dateFormat: 'yyyy-MM-dd'
        },
        {
          title: '跟踪人',
          dataIndex: 'TRANCER_NAME',
          sorter: true,
          filter: true,
          showOverflowTooltip: true
        },
        {
          title: '客户反馈',
          dataIndex: 'CUSTOMER_FEEDBACK',
          sorter: true,
          filter: true,
          showOverflowTooltip: true
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
          sorter: true,
          filter: true,
          showOverflowTooltip: true
        }
      ];
    },
    closeDialog() {
      this.$emit('closeDialog', false);
    }
  },
  mounted() {
    this.basetable = this.$refs.table.$refs.pageTable;
  }
};
</script>
